﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Mail;
using System.Text;

namespace Fly.Common.Email
{
    /// <summary>
    /// Email service.
    /// Simplly sends an email.
    /// </summary>
    public interface IEmailService
    {
        /// <summary>
        /// Configuration information needed for sending emails.
        /// </summary>
        EmailServiceSettings Settings { get; set; }


        /// <summary>
        /// Sends an email using the data from the message.
        /// </summary>
        /// <param name="message"></param>
        /// <returns></returns>
        bool Send(NotificationMessage message);


        /// <summary>
        /// Sends the specified message.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <param name="credentialsUser">The credentials user.</param>
        /// <param name="credentialsPassword">The credentials password.</param>
        /// <returns></returns>
        bool Send(NotificationMessage message, string credentialsUser, string credentialsPassword);


        /// <summary>
        /// Send the mailmessage.
        /// </summary>
        /// <param name="message">The mail message</param>
        /// <param name="useCredentials">Whether or not to use credentials for security when sending emails.</param>
        /// <param name="credentialsUser">User name when using credentials.</param>
        /// <param name="credentialsPassword">Password when using credentials.</param>
        /// <returns></returns>        
        bool Send(MailMessage message, bool useCredentials, string credentialsUser, string credentialsPassword);


        /// <summary>
        /// Mail the message using the native MailMessage class and the credentials from the current configuration.
        /// </summary>
        /// <param name="message">The mail message</param>
        /// <returns></returns>
        bool Send(MailMessage mailMessage);
    }
}
